package com.example.travelservlet.dynamic.dao;

import com.example.travelservlet.entity.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface DynamicMapper {
    Integer bindDynamicAndImage(@Param("dynamicId") String dynamicId, @Param("url") String url);
    Integer insertDynamic(Dynamic dynamic);
    List<DynamicDto> selectAllDynamic();
    List<DynamicDto> selectAllDynamicByLike();
    String findUserIdByDynamicId(String id);
    User findUserById(String user_id);
    void deleteDynamicById(String dynamicId);
    List<Dynamic> findDynamicByKeyWord(String key);

    List<DynamicDto> selectAllMyDynamic(String userId);

    List<DynamicDto> selectAllMyDynamicAndLike(String userId, String mineId);
    List<Dynamic> findAll();
    List<Dynamic> findAll1(int page,int size);
    Dynamic findDynamicById(String dynamic_id);
    List<DynamicComment> findDynamicCommentByDynamicId(String dynamicId);
    Integer updateLikeCount(@Param("dynamicId") String dynamicId, @Param("count")int count);
    Integer deleteDynamicByDynamicId(String dynamicId);
    Integer deleteCommentById(String dynamicId);
    Integer deleteLikeById(String dynamicId);

    List<Dynamic> findDynamicByKeyWord1(@Param("key") String key,@Param("page") Integer page,@Param("size") Integer size);
    List<DynamicPlus> findDynamicByKeyWord3(@Param("key") String key,@Param("page") Integer page,@Param("size") Integer size);
    List<DynamicPlus> selectDynamicPlus();
    List<DynamicPlus> selectDynamicPlus1(int page, int size);

    List<String> findUrls(String dynamic_id);
}
